package top.linyuxb.lycloud.admin.service;

import org.springframework.scheduling.annotation.Async;
import org.springframework.transaction.annotation.Transactional;
import top.linyuxb.lycloud.admin.entity.LyCloudUserEntity;
import top.linyuxb.lycloud.admin.entity.LyConfNodeEntity;
import top.linyuxb.lycloud.admin.utils.ReturnT;

import java.util.Map;

/**
 * Created by Intellij IDEA.
 *
 * @Author: linyuxb
 * @Date: 2024/7/29 14:43
 * @Desc:
 */
public interface ILyConfNodeService {

    Map<String, Object> pageList(int offset, int pagesize, String appname, String key, LyCloudUserEntity loginUser, String loginEnv);

    ReturnT<String> delete(Long id, LyCloudUserEntity loginUser, String loginEnv);

    ReturnT<String> add(LyConfNodeEntity lyConfNode, LyCloudUserEntity loginUser, String loginEnv);

    @Transactional(rollbackFor = Exception.class)
    ReturnT<String> update(LyConfNodeEntity lyConfNode, LyCloudUserEntity loginUser, String loginEnv);

    @Async
    void refreshConf(String env, String app);
}
